package main

import (
    "fmt"
    freejson "brick.dgd/brick/free-json"
)

type UserInfo struct {
    RealName             string   `protobuf:"bytes,1,opt,name=real_name,json=realName" json:"real_name,omitempty"`
    CredentialsType      uint32   `protobuf:"varint,2,opt,name=credentials_type,json=credentialsType" json:"credentials_type,omitempty"`
    CredentialsNum       string   `protobuf:"bytes,3,opt,name=credentials_num,json=credentialsNum" json:"credentials_num,omitempty"`
}

func main() {
    jsonStr := `[{"real_name": "姚杰鸿", "credentials_type": 0, "credentials_num": "440582198711050013"}, {"real_name": "姚杰鸿", "credentials_type": 0, "credentials_num": "440582198711050013"}, {"real_name": "姚杰鸿", "credentials_type": 0, "credentials_num": "440582198711050013"} ]`

    var userInfos []*UserInfo
    err := freejson.Unmarshal([]byte(jsonStr), &userInfos)
    if nil != err {
        panic(err)
    }
    for _, userInfo := range userInfos {
        fmt.Println(userInfo.RealName)
    }
}

